Skip to content

fix(rsc): ignore root resolution errors in rsc:virtual-client-package - #1309

Merged
hi-ogawa merged 4 commits into
vitejs:mainfrom
nihgwu:neo/fix-rsc-root-resolution-error
Jul 27, 2026
Merged

fix(rsc): ignore root resolution errors in rsc:virtual-client-package#1309
hi-ogawa merged 4 commits into
vitejs:mainfrom
nihgwu:neo/fix-rsc-root-resolution-error

Conversation

@nihgwu

@nihgwu nihgwu commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

The project-root eligibility check for client-package virtualisation added in #1277 assumes resolution returns null when a package subpath is unavailable from the root. It can instead throw when a different version of the same package exists at the root but does not export the requested subpath.

One real dependency shape is parse5 resolving entities/decode and entities/escape from a nested entities@6, while the application root has entities@4. Resolution from the actual importer is valid, but the root probe aborts the build.

Treat root-probe errors like unresolved or mismatched root results so the plugin falls back to the fully resolved module ID. Add an inline E2E fixture with incompatible root and compatible nested versions, covering both development and production builds.

Follow-up to #1277 and #1295.

@nihgwu
nihgwu marked this pull request as ready for review July 26, 2026 21:00
@nihgwu

nihgwu commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@hi-ogawa another blocker for us to upgrade to latest version 🙏

hi-ogawa and others added 2 commits July 27, 2026 12:04
Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa hi-ogawa changed the title fix(rsc): fall back on root resolution errors fix(rsc): ignore root resolution errors in rsc:virtual-client-package Jul 27, 2026

@hi-ogawa hi-ogawa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Adjusted e2e with better illustration.

@hi-ogawa
hi-ogawa merged commit d432264 into vitejs:main Jul 27, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants